home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 954 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: blv-pm3-ip24.halcyon.com!user
  2. From: hawkfish@punchdeck.com (Richard Wesley)
  3. Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3
  4. Subject: Re: Hungarian notation
  5. Date: Mon, 08 Jan 1996 09:04:58 -0800
  6. Organization: Punch Deck Consulting
  7. Message-ID: <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com>
  8. References: <30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com> <1996Jan7.045815.8676@ohstpy> <4cpb00$nqk@news.xmission.com>
  9. NNTP-Posting-Host: blv-pm3-ip24.halcyon.com
  10. X-Newsreader: Yet Another NewsWatcher 2.1.2
  11.  
  12. In article <4cpb00$nqk@news.xmission.com>, tknarr@xmission.com   ( Todd
  13. Knarr ) wrote:
  14. >I prefer prefixes that ignore type entirely and concentrate on purpose.
  15. >To me, the idea that a variable is a counter is more important than exactly
  16. >what size of counter it is. If I'm calculating an integral value, I like to
  17. >know if it's intended as an index into an array ( character strings come
  18. >to mind here ) as opposed to, say, the total hundredths of gallons of fuel
  19. >pumped from a pump. 
  20.  
  21. I've found it useful to use typedefs for all sorts of things like this. 
  22. Looping through a FooArray with a FooIndex is much more robust than using
  23. a long or something.
  24.  
  25. >Pointers vs. arrays is about the only useful low-level
  26. >concept where HN works well, because in C++ you use them in very much the
  27. >same way but there are some critical semantic differences that sometimes
  28. >come up and bite you.
  29.  
  30. This is reasonable for C, but these days I find myself using auto_ptr and
  31. my own auto_array templates to deal with this problem.  On the other hand,
  32. it could still be useful inside a class that used an array to represent
  33. something (e.g. a string).
  34.  
  35.  
  36. - rmgw
  37.  
  38. http://www.punchdeck.com/hawkfish/PunchDeck.html
  39.  
  40. ----------------------------------------------------------------------------
  41. Richard Wesley          | "Wind that frog!"
  42. hawkfish@punchdeck.com  |   - Tom Hanks ("Toy Story")
  43. ----------------------------------------------------------------------------
  44.